/**
 * @description 自动import导入所有 api 模块
 */
const modulesFiles = import.meta.globEager('./model/*.ts');
const pathList: string[] = [];
for (const path in modulesFiles) {
	pathList.push(path);
}
const modules = pathList.reduce((modules: { [x: string]: any }, modulePath: string) => {
	const moduleName = modulePath.replace(/^\.\/model\/(.*)\.\w+$/, '$1');
	const value: any = modulesFiles[modulePath];
	modules[moduleName] = value.default;
	return modules;
}, {});

export default modules;
